import request from '@/utils/request'

//获取商品列表
export function fetchList(params) {
  return request({
    url:'/shop/product/list',
    method:'get',
    params:params
  })
}

//修改商品状态
export function updateStatus(params) {
  return request({
    url:'/shop/product/update/publishStatus',
    method:'post',
    data:params
  })
}

//查看二维码
export function seeQrCode(id) {
  return request({
    url:'/shop/product/qrCode',
    method:'get',
    params:{goods_id:id}
  })
}

//根据商品栏目编号获得商品属性列表
export function getAttributeList(id) {
  return request({
    url:'/shop/goodsDetail/attributeList',
    method:'get',
    params:{category_id:id}
  })
}

//获取某个商品详情
export function getGoodsInfo(id) {
  return request({
    url:'/shop/product/detail',
    method:'get',
    params:{goods_id:id}
  })
}

//新建商品
export function createGoodsInfo(data) {
  return request({
    url:'/shop/product/create',
    method:'post',
    data:data
  })
}

//商品评论列表
export function getGoodsEvaluateList(data) {
  return request({
    url:'/shop/goods/evaluate',
    method:'post',
    data:data
  })
}


//提交评价回得
export function postRemark(data) {
  return request({
    url:'/shop/evaluate/remark',
    method:'post',
    data:data
  })
}

//置顶评论
export function topEvaluate(data) {
  return request({
    url:'/shop/evaluate/top',
    method:'post',
    data:data
  })
}


export function fetchSimpleList(params) {
  return request({
    url:'/product/simpleList',
    method:'get',
    params:params
  })
}

export function updateDeleteStatus(params) {
  return request({
    url:'/product/update/deleteStatus',
    method:'post',
    params:params
  })
}

export function updateNewStatus(params) {
  return request({
    url:'/product/update/newStatus',
    method:'post',
    params:params
  })
}

export function updateRecommendStatus(params) {
  return request({
    url:'/product/update/recommendStatus',
    method:'post',
    params:params
  })
}

export function updatePublishStatus(params) {
  return request({
    url:'/product/update/publishStatus',
    method:'post',
    params:params
  })
}

//编辑商品
export function updateProduct(id,data) {
  return request({
    url:'/shop/product/update',
    method:'post',
    data:data
  })
}

export function getProduct(id) {
  return request({
    url:'/product/updateInfo/'+id,
    method:'get',
  })
}


//修改虚拟销量
export function updateVirtualSales(data) {
  return request({
    url:'/shop/goods/updateVirtualSales',
    method:'post',
    data:data
  })
}

//修改商品排序
export function updateBatchSort(data) {
  return request({
    url:'/shop/goods/batchSort',
    method:'post',
    data:data
  })
}

//商品列表导出
export function goodsExport() {
  return request({
    url:'/shop/goods/export',
    method:'get',

  })
}

//商品批量修改价格
export function goodsBatchEdit(data) {
  return request({
    url:'/shop/goods/batchEdit',
    method:'POST',
    data:data

  })
}



//商品批量导入
export function importGoods(data) {
  return request({
    url:'/shop/goods/importGoods',
    method:'POST',
    data:data

  })
}


//商品添加评价
export function addVirtualComments(data) {
  return request({
    url:'/shop/goods/addVirtualComments',
    method:'POST',
    data:data
  })
}


//商品删除评价
export function delVirtualComments(data) {
  return request({
    url:'/shop/goods/delVirtualComments',
    method:'POST',
    data:data
  })
}


//客户开发等级
export function lastTracking(data) {
  return request({
    url:'/tracking/lastTracking',
    method:'POST',
    data:data
  })
}

//选择品类列表
export function categoryList(data) {
  return request({
    url:'/goods/categoryList',
    method:'POST',
    data:data
  })
}

//选择品类库存图表
export function stockPriceTrend(data) {
  return request({
    url:'/goods/stockPriceTrend',
    method:'POST',
    data:data
  })
}

//选择品类库存列表
export function stockPriceList(data) {
  return request({
    url:'/goods/stockPriceList',
    method:'POST',
    data:data
  })
}

// 修改品类仓库报表数据
export function updateStockPrice(data) {
  return request({
    url:'/goods/updateStockPrice',
    method:'POST',
    data:data
  })
}


// 新增/编辑摩塑网商品资料
export function setDocumentFile(data) {
  return request({
    url:'/common/setDocumentFile',
    method:'POST',
    data:data
  })
}


export function delDocumentFile(data) {
  return request({
    url:'/common/delDocumentFile',
    method:'POST',
    data:data
  })
}

export function getDocumentClassList(data) {
  return request({
    url:'/common/getDocumentClassList',
    method:'POST',
    data:data
  })
}

export function setDocumentClass(data) {
  return request({
    url:'/common/setDocumentClass',
    method:'POST',
    data:data
  })
}

export function delDocumentClass(data) {
  return request({
    url:'/common/delDocumentClass',
    method:'POST',
    data:data
  })
}

export function getCategoryList(data) {
  return request({
    url:'/common/getCategoryList',
    method:'POST',
    data:data
  })
}

export function getBrandList(data) {
  return request({
    url:'/common/getBrandList',
    method:'POST',
    data:data
  })
}

export function getGoodSnList(data) {
  return request({
    url:'/common/getGoodSnList',
    method:'POST',
    data:data
  })
}
